package com.gxa.autoparts.portal.repository;

import com.gxa.autoparts.core.common.GoodsVo;
import org.springframework.data.elasticsearch.repository.ElasticsearchRepository;
import org.springframework.stereotype.Component;

import java.util.List;

/**
 * @author ：looker
 * @date ：Created in 2022/1/7 13:54
 */
@Component
public interface GoodsVoRepository extends ElasticsearchRepository<GoodsVo,Long> {

    //无序模糊查询
    List<GoodsVo> findGoodsVoByNameContains(String name);

    //无序模糊查询  销量降序
    List<GoodsVo> findGoodsVoByNameContainsOrderBySaleCountDesc(String name);

    //无序模糊查询  价格升序
    List<GoodsVo> findGoodsVoByNameContainsOrderBySalePriceAsc(String name);

    //无序模糊查询  价格降序
    List<GoodsVo> findGoodsVoByNameContainsOrderBySalePriceDesc(String name);

    //无序加分类模糊查询
    List<GoodsVo> findGoodsVoByNameContainsAndTypeIdEquals(String name,Long id);

    //分类模糊 加销售数目降序
    List<GoodsVo> findGoodsVoByNameContainsAndTypeIdEqualsOrderBySaleCountDesc(String name,Long id);

    //分类模糊 价格降序
    List<GoodsVo> findGoodsVoByNameContainsAndTypeIdEqualsOrderBySalePriceDesc(String name,Long id);

    //分类模糊  价格升序
    List<GoodsVo> findGoodsVoByNameContainsAndTypeIdEqualsOrderBySalePriceAsc(String name,Long id);
}
